package com.example.lotterysystem.common.utils;


import cn.hutool.captcha.LineCaptcha;
import cn.hutool.captcha.generator.RandomGenerator;

public class CaptchaUtil {
    public static String getCaptcha(int len){
        RandomGenerator randomGenerator = new RandomGenerator("0123456789", len);
        LineCaptcha lineCaptcha = cn.hutool.captcha.CaptchaUtil.createLineCaptcha(200, 100);
        lineCaptcha.setGenerator(randomGenerator);
        lineCaptcha.createCode();
        return lineCaptcha.getCode();
    }
}
